<?php
/**
 * QQAS - share your knowledge to the world!
 *
 * @author		xiaochong0302 <xiaochong0302@gmail.com>
 * @copyright	Copyright (c) 2011, Koogua Studio.
 * @license		http://www.qqas.org/user_guide/license.html
 * @link		http://www.qqas.org
 * @since		Version 1.0
 * @filesource
 */


class AdminGroupModel extends Model
{


	//通过用户组ID取用户组信息
	public function getGroupByID($group_id)
	{
		$where['group_id'] = intval($group_id);
		return $this->where($where)->find();
	}


	//缓存管理用户组
	public function cacheAdminGroup($groupID=0)
	{
	    if ($groupID)
    	{
    		$where  = array('group_id' => $groupID);
    		$result = $this->where($where)->find();
    		if ($result)
    		{
    			F('cache_admingroup_'.$groupID, $result);
    		}
    	}
    	else
    	{
    		$result = $this->select();
    		if ($result)
    		{
    			foreach ($result as $value)
    			{
    				F('cache_admingroup_'.$value['group_id'], $value);
    			}
    		}
    	}
	}

}

/* End of file AdminGroupModel.class.php */
/* Location: ./App/Lib/Model/AdminGroupModel.class.php */